<template>
  <layout :config="navConfig">
    <template #default>
      <div class="m-service_box">
        <div class="login-logo">
          <img src="../assets/img/SD-01.png" style="width: 100px;height: 100px">
        </div>

        <div class="answer-box" style="width: 100%;height: 400px" id="main">
          <template>
            <div>
              <organization-chart zoomin-limit="2" :datasource="ds"></organization-chart>
            </div>
          </template>
        </div>




      </div>
    </template>
  </layout>
</template>

<script lang="ts">
    import { Component, Vue } from "vue-property-decorator";
    import { INavigation } from "@/types";
    import {Toast} from 'mand-mobile'
    import OrganizationChart from 'vue-organization-chart'
    import 'vue-organization-chart/dist/orgchart.css'


    @Component({
        name: "Service",
        created: function () {
            let usera = JSON.parse(localStorage.getItem('users1'));

            if(usera==null){
                this.$router.push({
                    path: '/login'
                })
                return;
            }

            Toast.loading("请求中...");
            this.$api.menu({username:"111"}).then(res => {
                Toast.hide();
                if (res.success == 200) {
                    this.ds = res.data;
                }
            }).catch(res => {
                Toast.loading(res.toString());
                Toast.hide();
            })


        },
        mounted(){

        },
        components: {
            OrganizationChart
        }
    })
    export default class extends Vue {
        navConfig: INavigation = {
            text: "我的团队"
        };
        ds= {
        };
        listData = [

        ];
    }
</script>

<style lang="scss">
  @import "../assets/styles/service.scss";
</style>

